Get(DicomScp,string,List<PresentationContext>) Method

Summary

Sends a STUDY-level C-GET-REQ message to a peer member of a connection defined by Scp.

Syntax
C#
VB
C++
  
Public Overloads Sub Get( _ 
   ByVal Scp As DicomScp, _ 
   ByVal StudyInstanceUID As String, _ 
   ByVal additionalPresentationContexts As List(Of PresentationContext) _ 
)  
public: 
void Get(  
   DicomScp^ Scp, 
   String^ StudyInstanceUID, 
   List<PresentationContext^>^ additionalPresentationContexts 
)  

Parameters

Scp
The peer connection to send the C-GET-REQ to.

StudyInstanceUID
The study instance UID of the study to retrieve.

additionalPresentationContexts
A list of presentation contexts to add to the Leadtools.Dicom.DicomAssociate

Remarks

This method uses a C-GET to retrieve a complete study. Note that the C-GET differs from the C-MOVE in that the C-GET requests and retrieves information on the same DICOM assocation. This means that you need to know the SOP Class UID of the DICOM instances that are to be retrieved prior to the DICOM assocation. You can add these additional SOP Classes to the association by using the additionalPresentationContexts parameter. The example shows how this is done.

Example

This example retrieves instances from a DICOM Server that supports C-GET Specifically, it retrieves the five SMITH^TERRY instances that are in the LXX_SERVER32 database of the CSLeadtools.Dicom.Server.exe Replace XX with the version of the toolkit (i.e. for version 19, this would be L19_SERVER32) There are four overloads for Get This examples illustrates how to use three of the overloads (study level, series level, instance level) Uncomment any of the overloads in the example to see how it is used

C#
VB
using Leadtools; 
using Leadtools.Dicom.Scu; 
using Leadtools.Dicom.Scu.Common; 
using Leadtools.Dicom; 
using Leadtools.Dicom.Common.DataTypes; 
 
public void QueryRetrieveScu_Get1() 
{ 
   DicomEngine.Startup(); 
   DicomNet.Startup(); 
 
   // 
   // Change these parameters to reflect the calling AETitle. 
   // 
   QueryRetrieveScu getScu = new QueryRetrieveScu(); 
   getScu.AETitle = "LEAD_CLIENT"; 
   getScu.HostPort = 1000; 
   getScu.HostAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork); 
 
 
   // 
   // Change these parameters to reflect the called AETitle (server). 
   // 
   DicomScp scp = new DicomScp(); 
   scp.AETitle = "LEAD_GET_SCP"; 
   scp.Port = 404; 
   scp.Timeout = 60; 
   scp.PeerAddress = IPAddress.Parse("192.168.0.168"); 
 
   getScu.BeforeCGet += new BeforeCGetDelegate(getStudy_BeforeCGet); 
   getScu.AfterCGet += new AfterCGetDelegate(getStudy_AfterCGet); 
   getScu.ReceivedStoreRequest += new ReceivedStoreRequestDelegate(getStudy_ReceivedStoreRequest); 
 
   // The C-GET must know the Media Storage SOP Class UID of the DICOM Datasets that you want to retrieve 
   // In this example, the five SMITH^TERRY instances are retrieved 
   //    SOP Class UID of the instances is: 
   //       MR Image Storage 
   //       1.2.840.10008.5.1.4.1.1.4 
   //    StudyInstanceUid of the study is: 
   //       1.3.12.2.1107.5.2.31.30563.30000008120313112035900000034 
   //    SeriesInstanceUid of the series is: 
   //       1.3.12.2.1107.5.2.31.30563.2008120317404292381631917.0.0.0 
   //    SOPInstanceUid of one of the five instances is: 
   //       1.3.12.2.1107.5.2.31.30563.2008120317404382714631941 
 
   string studyInstanceUid = "1.3.12.2.1107.5.2.31.30563.30000008120313112035900000034"; 
   string seriesInstanceUid = "1.3.12.2.1107.5.2.31.30563.2008120317404292381631917.0.0.0"; 
   string sopInstanceUid = "1.3.12.2.1107.5.2.31.30563.2008120317404382714631941"; 
 
   PresentationContext pc = new PresentationContext(DicomUidType.MRImageStorage); 
   pc.TransferSyntaxes.Add(DicomUidType.ImplicitVRLittleEndian); 
 
   // Alternatively, you can create the presentation context if you have a compatible DicomDataSet 
   // This is illustrated, but 'pc' will be used 
   PresentationContext pcAnotherWay; 
   string compatibleDicomName = @"D:\erase\dicom\compatible.dcm"; 
   if (File.Exists(compatibleDicomName)) 
   { 
      DicomDataSet dsCompatible = new DicomDataSet(); 
      dsCompatible.Load(compatibleDicomName, DicomDataSetLoadFlags.None); 
      pcAnotherWay = QueryRetrieveScu.GetCompatiblePresentationContext(dsCompatible); 
   } 
 
   List<PresentationContext> pcList = new List<PresentationContext>(); 
   pcList.Add(pc); 
 
   // There are four overloads for Get 
   // This examples illustrates how to use three of the overloads (study leve, series level, instance level) 
 
   // Uncomment whichever overload you want to use 
 
   // StudyLevel -- retrieves five instances 
   // getStudy.Get(scp, studyInstanceUid, pcList); 
 
   // SeriesLevel -- retrieves three instances 
   // getStudy.Get(scp, studyInstanceUid, seriesInstanceUid, pcList); 
 
   // InstanceLevel -- retrieves one instance 
   getScu.Get(scp, studyInstanceUid, seriesInstanceUid, sopInstanceUid, pcList); 
 
   DicomNet.Shutdown(); 
   DicomEngine.Shutdown(); 
} 
 
void getStudy_BeforeCGet(object sender, BeforeCGetEventArgs e) 
{ 
   Console.WriteLine("Before CGet"); 
} 
 
void getStudy_ReceivedStoreRequest(object sender, ReceivedStoreRequestEventArgs e) 
{ 
   Console.WriteLine("=========================================="); 
   Console.WriteLine("Patient Name:\t{0}", e.Patient.Name.Full); 
   Console.WriteLine("SOPInstanceUID:\t{0}", e.Instance.SOPInstanceUID); 
} 
 
void getStudy_AfterCGet(object sender, AfterCGetEventArgs e) 
{ 
   Console.WriteLine("After CGet"); 
   Console.WriteLine("\t{0} Completed", e.Completed); 
   Console.WriteLine("\t{0} Failed", e.Failed); 
   Console.WriteLine("\t{0} Warning", e.Warning); 
   Console.WriteLine("\tStatus: {0}", e.Status); 
} 
Imports Leadtools 
Imports Leadtools.Dicom.Scu 
Imports Leadtools.Dicom.Scu.Common 
Imports Leadtools.Dicom 
Imports Leadtools.Dicom.Common.DataTypes 
 
Public Sub QueryRetrieveScu_Get1() 
   DicomEngine.Startup() 
   DicomNet.Startup() 
 
   ' 
   ' Change these parameters to reflect the calling AETitle. 
   ' 
   Dim getScu As New QueryRetrieveScu() 
   getScu.AETitle = "LEAD_CLIENT" 
   getScu.HostPort = 1000 
   getScu.HostAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault(Function(ip) ip.AddressFamily = AddressFamily.InterNetwork) 
 
 
   ' 
   ' Change these parameters to reflect the called AETitle (server). 
   ' 
   Dim scp As New DicomScp() 
   scp.AETitle = "LEAD_GET_SCP" 
   scp.Port = 404 
   scp.Timeout = 60 
   scp.PeerAddress = IPAddress.Parse("192.168.0.168") 
 
   AddHandler getScu.BeforeCGet, AddressOf getStudy_BeforeCGet 
   AddHandler getScu.AfterCGet, AddressOf getStudy_AfterCGet 
   AddHandler getScu.ReceivedStoreRequest, AddressOf getStudy_ReceivedStoreRequest 
 
   ' The C-GET must know the Media Storage SOP Class UID of the DICOM Datasets that you want to retrieve 
   ' In this example, the five SMITH^TERRY instances are retrieved 
   '    SOP Class UID of the instances is: 
   '       MR Image Storage 
   '       1.2.840.10008.5.1.4.1.1.4 
   '    StudyInstanceUid of the study is: 
   '       1.3.12.2.1107.5.2.31.30563.30000008120313112035900000034 
   '    SeriesInstanceUid of the series is: 
   '       1.3.12.2.1107.5.2.31.30563.2008120317404292381631917.0.0.0 
   '    SOPInstanceUid of one of the five instances is: 
   '       1.3.12.2.1107.5.2.31.30563.2008120317404382714631941 
 
   Dim studyInstanceUid As String = "1.3.12.2.1107.5.2.31.30563.30000008120313112035900000034" 
   Dim seriesInstanceUid As String = "1.3.12.2.1107.5.2.31.30563.2008120317404292381631917.0.0.0" 
   Dim sopInstanceUid As String = "1.3.12.2.1107.5.2.31.30563.2008120317404382714631941" 
 
   Dim pc As New PresentationContext(DicomUidType.MRImageStorage) 
   pc.TransferSyntaxes.Add(DicomUidType.ImplicitVRLittleEndian) 
 
   ' Alternatively, you can create the presentation context if you have a compatible DicomDataSet 
   ' This is illustrated, but 'pc' will be used 
   Dim pcAnotherWay As PresentationContext 
   Dim compatibleDicomName As String = "D:\erase\dicom\compatible.dcm" 
   If File.Exists(compatibleDicomName) Then 
      Dim dsCompatible As New DicomDataSet() 
      dsCompatible.Load(compatibleDicomName, DicomDataSetLoadFlags.None) 
      pcAnotherWay = QueryRetrieveScu.GetCompatiblePresentationContext(dsCompatible) 
   End If 
 
   Dim pcList As New List(Of PresentationContext)() 
   pcList.Add(pc) 
 
   ' There are four overloads for Get 
   ' This examples illustrates how to use three of the overloads (study leve, series level, instance level) 
 
   ' Uncomment whichever overload you want to use 
 
   ' StudyLevel -- retrieves five instances 
   ' getStudy.Get(scp, studyInstanceUid, pcList); 
 
   ' SeriesLevel -- retrieves three instances 
   ' getStudy.Get(scp, studyInstanceUid, seriesInstanceUid, pcList); 
 
   ' InstanceLevel -- retrieves one instance 
   getScu.Get(scp, studyInstanceUid, seriesInstanceUid, sopInstanceUid, pcList) 
 
   DicomNet.Shutdown() 
   DicomEngine.Shutdown() 
End Sub 
 
Private Sub getStudy_BeforeCGet(ByVal sender As Object, ByVal e As BeforeCGetEventArgs) 
   Console.WriteLine("Before CGet") 
End Sub 
 
Private Sub getStudy_ReceivedStoreRequest(ByVal sender As Object, ByVal e As ReceivedStoreRequestEventArgs) 
   Console.WriteLine("==========================================") 
   Console.WriteLine("Patient Name:" & Constants.vbTab & "{0}", e.Patient.Name.Full) 
   Console.WriteLine("SOPInstanceUID:" & Constants.vbTab & "{0}", e.Instance.SOPInstanceUID) 
End Sub 
 
Private Sub getStudy_AfterCGet(ByVal sender As Object, ByVal e As AfterCGetEventArgs) 
   Console.WriteLine("After CGet") 
   Console.WriteLine(Constants.vbTab & "{0} Completed", e.Completed) 
   Console.WriteLine(Constants.vbTab & "{0} Failed", e.Failed) 
   Console.WriteLine(Constants.vbTab & "{0} Warning", e.Warning) 
   Console.WriteLine(Constants.vbTab & "Status: {0}", e.Status) 
End Sub 

Requirements

Target Platforms

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom.Scu Assembly